<template>
<!-- 重构yes or no answer  -->
  <view class="outer">
    <!-- <multi-choice :choice="[{ content: '有' }, { content: '无' }]" @choose="choose" v-if="!has" /> -->
    <!-- <answer v-if="has" /> -->


   <van-radio-group :value="checked">
  <van-cell-group inset>
    <van-cell title="有" clickable :data-name="'是'"  @click="onClick">
      <template #right-icon>
        <van-radio :name="'是'" />
      </template>
    </van-cell>
    <van-cell title="无" clickable :data-name="'否'" @click="onClick">
      <template #right-icon >
        <van-radio :name="'否'" />
      </template>
    </van-cell>
  </van-cell-group>
    </van-radio-group>

   </view>
</template>

<script>
export default {
  data() {
    return {
      checked:null
    }
  },
  methods: {
    // choose(e) {
    //   this.has = e;
    // }
    onChange(e){
      console.log("c")
    },
    onClick(e){
      this.checked = e.currentTarget.dataset.name
      console.log(this.checked)
    }
    },
    watch:{
      checked(){
        this.$emit("choose",this.checked)
      }
    }

}
</script>

<style scoped>
.outer {
  height: 100%;
}
</style>